	var id = $("#container").attr("class");
	if(id == ''){
		alert("齱ֻעûţǱվעԱȵ¼ǣעɧ꣡");
		window.location.href="login.html";									
	}else{
		$(document).ready(function(){
			$("#table").find("dt").click(function(){
				$dt = $(this);
				var lottery = $dt.html();
				var id = $("#container").attr("class");
				$dt.flip({
					direction:'lr',
					onEnd:function(){
						$("#table").find("dt").unbind("click").css("cursor","default");
						$.ajax({
							url: "like_ajax.php",
							data: {lottery:lottery,id:id},
							type: "post",
							success:function(data){
								if(data = 1){
									$dt.html("积分不够了~~");
									alert("积分不足不够你来抽奖，赶紧去下载应用赢积分吧");
								}else{
									$dt.addClass("select").html("<img src='"+data+"' />");
									$("#table").find("#button").show();
									$("#table").find("#again").show();
								}
							}
						});
					}
				});
			});
		});							
		$(document).ready(function(){
			$("#button").click(function(){
				var length = document.getElementById("table").getElementsByTagName("dt").length;
				for(var i=0;i<length;i++){
					$select = $("#table").find("dt").eq(i);
					var value = $select.attr("option-value");
					if(!$select.hasClass("select")){
						$select.flip({
							direction:'lr',
							content:"<img src='"+value+"' />",
							onEnd:function(){
								$("#table").find("#button").unbind("click").css("cursor","default");
							}
						});
					}else{
						continue;
					}
				}									
			});
		});
	}//齱ҳAJAX